﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<#include "/pages/include/include.ftl" />
<@h.css href="/css/uc.css"/>
<@h.js src="/javascripts/public/myfile.js"/>
<#include "/pages/include/setlayout.ftl" />
<script type="text/javascript">
	var myfile=new myfile();
		$(function(){
			//$("#navtab1").ligerTab({
			//	onBeforeSelectTabItem:function(TabID){
			//		if($('#tab').val()==TabID)
			//			return;
			//		$('#'+TabID).loading();
			//		window.location.href="?curTab="+TabID+"&status="+TabID;
			//	}
			//});
			$("#navtab1").ligerTab();
			//all select
			$('#APPROVE .allSelect').click(function(){
				myfile.checkAPPROVE($(this));
			});
			$('#SUBMITTING .allSelect').click(function(){
				myfile.checkSUBMITTING($(this));
			});
			//delete
			$('#delApprove').click(function(){
				myfile.delApprove();
			});
			$('#delSubmitting').click(function(){
				myfile.delSubmitting();
			});
			$('#changeCateBatch').click(function(){
				myfile.changeCateBatch();
			}); 
			$('#approveBatch').click(function(){
				myfile.approveBatch();
			});
		});
</script>
</head>

<body>
<#assign menuId="adminfile">
<div id="layout1" class="wrapper">

	<#include "/pages/include/top.ftl" />
	
	<#include "/pages/person/myfile/file_menu.ftl" />
	
	<div position="center" title="文件管理">
		<div class="content-section">
			<div id="navtab1">
				<!--
				<div id="APPROVE" tabid="APPROVE" <#if curTab='APPROVE'>lselected="true"</#if>  title="已发布">
					<div class="action-div">
						<#if action.hasAuth("FILE_ADMIN_DEL_PUB")>
						<a id="delApprove" class="minibutton"><span>删除</span></a>
						</#if>
						<a id="upApprove" href="${contextPath}/myfile/myfile-gotoAdminUpload.action" class="minibutton" style="width:70px;"><span>上传文件</span></a>
					</div>
					<div  class="sList" >
					<table width="100%" class="sTable" cellpadding="0" cellspacing="0" border="0" >
						<tr>
							<td class="sTh checkbox" ><input class="inputCheckbox allSelect" type="checkbox" id="" name="" /></td>
							<th class="sTh">文档名称</th>
							<th class="sTh">分类</th>
							<th class="sTh">浏览量</th>
							<th class="sTh">下载量</th>
							<th class="sTh">上传时间</th>
							<th class="sTh">操作</th>
						</tr>
					<#if filePage?exists>
					<#list filePage.result as a>
						<tr class="<#if a_index%2==0>sRow2<#else>sRow1</#if>">
						<td class="sCell" ><input class="inputCheckbox selectItem" type="checkbox" value="${a.id?if_exists}" /></td>
							<td class="sCell">
							<a class="f14" href="${contextPath}/myfile/myfile-showFile.action?fileId=${a.id?if_exists}" title="${a.fileName?if_exists} ">
							${a.fileName?if_exists} </a></td>
							<td class="sCell">${a.category?if_exists}</td>
							<td class="sCell">${a.browserSum?if_exists}</td>
							<td class="sCell">${a.downSum?if_exists}</td>
							<td class="sCell">${a.publishTime?if_exists}</td>
							<td class="sCell">
							<a class="op" href="${contextPath}/myfile/myfile-gotoEditFile.action?fileId=${a.id?if_exists}&from=admin">编辑</a>
							</td>
						</tr>
					</#list>
					</#if>
					</table>
					</div>
					<@s.component id="page" template="components/page.ftl"> 
							<@s.param name="page" value="%{filePage}" />
							<@s.param name="pageRange" value="%{pageRange}" />
							<@s.param name="param" value="%{action.param}" />
					</@s.component>
				</div>
				-->
				<div id="SUBMITTING" tabid="SUBMITTING" <#if curTab='SUBMITTING'>lselected="true"</#if> title="员工上传" >
					<div class="action-div">
						<#if action.hasAuth("FILE_ADMIN_DEL_UP")>
						<a id="delSubmitting" class="minibutton"><span>删除</span></a>
						</#if>
						<#if action.hasAuth("FILE_ADMIN_DOWN_PAK")>
						<a class="minibutton" href="javascript:myfile.batchDown();" style="width:70px;"><span>打包下载</span></a>
						</#if>
						<!--<a id="approveBatch" class="minibutton"><span>通过</span></a>
						<a id="changeCateBatch" class="minibutton"><span>更改分类</span></a>-->
					</div>
					<div  class="sList" >
					<table width="100%" class="sTable" cellpadding="0" cellspacing="0" border="0" >
						<tr>
							<td class="sTh checkbox" ><input class="inputCheckbox allSelect" type="checkbox" id="" name="" /></td>
							<th class="sTh">文档名称</th>
							<th class="sTh">建议分类</th>
							<th class="sTh">上传时间</th>
                            <th class="sTh">上传用户</th>
							<th class="sTh">操作</th>
						</tr>
					<#if filePage?exists>
					<#list filePage.result as a>
						<tr class="<#if a_index%2==0>sRow2<#else>sRow1</#if>">
							<td class="sCell" ><input class="inputCheckbox selectItem" type="checkbox" value="${a.id?if_exists}" /></td>
							<td class="sCell">
								${a.fileName?if_exists}
							<!--<a class="f14" href="${contextPath}/myfile/myfile-showFile.action?fileId=${a.id?if_exists}" title="${a.fileName?if_exists} ">
							${a.fileName?if_exists} </a>--></td>
							<td class="sCell">${a.category?if_exists}</td>
							<td class="sCell">${a.uploadTime?if_exists}</td>
                            <td class="sCell"><#if a.publishUserName?exists>${a.publishUserName?if_exists}<#else>${a.publishUser?if_exists}</#if></td>
							<td class="sCell" style="width:300px;" align="left">
								<!--<a class="sliverbutton" href="${contextPath}/myfile/myfile-gotoEditFile.action?fileId=${a.id?if_exists}&from=admin"><span>编辑</span></a>
								<a class="sliverbutton" onclick="if(confirm('通过文件审核，文件将移到已发布列表，确定？')){myfile.approve(${a.id?if_exists});};"><span>通过</span></a>
								<a class="sliverbutton" onclick="myfile.changeCate(${a.id?if_exists});"><span>更改分类</span></a>--> 
								<#if a.attachments?exists>
									<#list a.attachments as atts>
										<a class="sliverbutton" href="${contextPath}/download.action?id=${atts.id?if_exists}&from=1&folder=temp"><span>下载</span></a>
									</#list>
								</#if>
								<a class="sliverbutton" href="${contextPath}/myfile/myfile-gotoEditFile.action?fileId=${a.id?if_exists}&from=admin"><span>编辑</span></a>
								<a class="sliverbutton" href="javascript:myfile.moveFile(${a.id?if_exists});"><span>移至建议分类</span></a>
							</td>
						</tr>
					</#list>
					</#if>
					</table>
					</div>
					<@s.component id="page" template="components/page.ftl"> 
							<@s.param name="page" value="%{filePage}" />
							<@s.param name="pageRange" value="%{pageRange}" />
							<@s.param name="param" value="%{action.param}" />
					</@s.component>
				</div>
			</div>
		</div>
	</div>
	
	<#include "/pages/include/bottom.ftl" />
	
	<input type="hidden" id="tab" value="${curTab}"/>
</div>

</body>

</html>
